

public class VisitedCellHelperImpl implements VisitedCellHelper 
{
	
	private boolean[][] board;
	
	public VisitedCellHelperImpl( Board.CellType[][] boardReference )
	{
		board = new boolean[ (boardReference.length) ][ (boardReference[0].length) ];
	}
	
	public VisitedCellHelperImpl( boolean[][] board )
	{
		this.board = board;
	}

	@Override
	public boolean unisitedCell(Move move) 
	{
		return (!board[ move.getX() ][ move.getY() ]);
	}

	@Override
	public boolean unisitedCell(int x, int y) 
	{
		return (!board[ x ][ y ]);
	}

	@Override
	public void registerCellAsVisited(Move move) 
	{
		board[ move.getX() ][ move.getY() ] = true;
	}

	@Override
	public void registerCellAsVisited(int x, int y) 
	{
		board[ x ][ y ] = true;
	}
	
	@Override
	public VisitedCellHelperImpl clone()
	{
		
		return new VisitedCellHelperImpl( board.clone() );
		
	}

}
